// @ts-ignore
/* eslint-disable */
import { CodeFilled } from '@ant-design/icons';
import { request} from '@umijs/max';
import Cookies from 'js-cookie';
//获取用户验证cookie
var mytoken=Cookies.get('token');


/** 连接后端服务器接口，获取系统设置的数据 */
//注意：在后端的接口规范中，要参照标准，一定要包含data对象，这样在接收返回接果时，就可以用useRequest
export async function getSysparam(options?:{[key:string]:any}){
    // return request('/basis_api/sysparam/pool/0',{
      //method:'GET',
      //...(options||{}),
     //});

     //  return {data:[{id:1,iname:'nnnn1'},{id:2,iname:'nnnn2'}]}
  // return {a:100};
//}

     return request('/basis_api/sysparam/pool/0',{
      method:'GET',
      ...(options||{}),
     });
    }

/**更新系统参数。传入一个对象，即要更改的参数数组对象，格式为：data:{[]} */
/**在此函数为测试性质，因此只传入简单的sid+value全部更新。实际项目中，应加入时间戳加以判断  */
export async function setSysparam(body: any, options?: { [key: string]: any }) {
     //alert(JSON.stringify(body));
     return request('/basis_api/sysparam/update', {
       method: 'POST',
       headers: {
         'Content-Type': 'application/json',
       },
       data:  body ,    //注意：此处一定要用data:对象。。。
       ...(options || {}),
       
     });
   }

//获取区域树的值
   export async function getAreaTree(options?:{[key:string]:any}){
    return request('/basis_api/areatree',{
     method:'GET',
     ...(options||{}),
    });
  }



  ///basis_api/treedata/materialcategory     ----------获取物料分类树的值------
  export async function s_getMaterialCategoryTree(options?:{[key:string]:any}){
    return request('/basis_api/treedata/materialcategory',{
     method:'GET',
     ...(options||{}),
    });
  }


//获取组织树
    export async function getOrgTree(options?:{[key:string]:any}){
      return request('/basis_api/orgtree',{
        method:'GET',
        ...(options||{}),
      });
}

//获取计量单位组树
export async function getUnitgroupTree(options?:{[key:string]:any}){
  return request('/basis_api/unitgrouptree',{
    method:'GET',
    ...(options||{}),
  });
}

//获取仓库列表：注意参数的传入，如为参数传入，则在request中不用加params;当为表单等方式提交时，
//可以在request体中添加params，类似URL带?X=Y。
export async function getWarehouseTableByXId(params:{x_id:number,org_id:number},options?:{[key:string]:any}){
     const {x_id:param0,org_id:param1,...queryParams}=params;
      return request(`/basis_api/warehousetable/xid/${param0}/${param1}`,{   //带参数的功能，用一天研究出来。。汗20230922
      method:'GET',
      ...(options||{}),
  });
}

//获取区域明细信息
export async function  getAreaInfo(params:{code:any},options?:{[key:string]:any}){
  const {code:param0,...queryPamrams}=params;
  // console.log(`/basis_api/area/${param0}`);
  let token=Cookies.get('token');
 const x=request(`/basis_api/area/${param0}`,{
    method:'GET',
    headers:{'Content-type':'application/json',
              'Authorization': `Bearer ${token}`
     },
    ...(options||{}),
  });
 
  return x;
}

//获取系统信息
export async function  s_getSysInfo(params:{x_id:number},options?:{[key:string]:any}){
  const {x_id:param0,...queryPamrams}=params;
  // console.log(`/basis_api/area/${param0}`);
 const x=request(`/basis_api/sysinfo/get/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}

//**--保存系统信息 */
export async function s_saveSysInfo(body:{},options?:{[key:string]:any}){
  return request('/basis_api/sysinfo/update',{
  method:'POST',
  headers:{'Content-Type':'application/json'},
  data:body,   //注意，此处传送data对象
...(options||{}),
}

);
}

//**--区域---------保存修改后的数据 body传入包含2个属性：ttype\tdata*/
export async function updateAreaInfo(body:{},options?:{[key:string]:any}){
    return request('/basis_api/area/update',{
    method:'POST',
    headers:{'Content-Type':'application/json'},
    data:body,   //注意，此处传送data对象
  ...(options||{}),
  }

  );
}

//----------------------------------------------保存树编辑节点信息   通用树-------------------------------------------------------
export default function updateTreeNodeInfo(body:{},options?:{[key:string]:any}){
  return request('/basis_api/fulltree/update',{
    method:'POST',
    headers:{'Content-Type':'application/json'},
    data:body,
    ...(options||{}),
  });
}

//获取组织明细信息
export async function  getOrgInfo(params:{code:any},options?:{[key:string]:any}){
  const {code:param0,...queryPamrams}=params;
  // console.log(`/basis_api/area/${param0}`);
 const x=request(`/basis_api/organization/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}

//保存组织的修改信息
export async function saveOrganization(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/organization/save',{
      method:'POST',
      headers:{'Content-type':'application/json'},
      data:body,
      ...(options||{}),
   });
 
 }

 //s_getChanelList  ----------------------------获取渠道列表，两个参数：类别keys，渠道id:0为全部----------------------
 export async function s_getChanelList(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/chanel/info/get',{
      method:'POST',
      headers:{'Content-type':'application/json'},
      data:body,
      ...(options||{}),
   });
 
 }
//s_freezeShipping--------------------------------------船公司操作-----------------------
export async function  s_freezeShipping(params:{id:number,type:number},options?:{[key:string]:any}){
  const {id:param0,type:param1,...queryPamrams}=params;
  // console.log(`/basis_api/shipping/freeze/${param1}/${param0}`);
 const x=request(`/basis_api/shipping/freeze/${param1}/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}
//s_saveShipping  ----------------------------------------------------保存船公司---------------
export async function s_saveShippingInfo(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/shipping/info/save',{
      method:'POST',
      headers:{'Content-type':'application/json'},
      data:body,
      ...(options||{}),
   });
 }

 //s_getPostCodeInfo ------------------------------获取邮编/仓库列表2024-10-20-----------------
 export async function s_getPostWareInfo(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/base/postware/info/get',{
      method:'POST',
      headers:{'Content-type':'application/json'},
      data:body,
      ...(options||{}),
   });
 
 }
//s_operateInfoPrice ---------------------------更新价格表操作--------------------------------------
export async function s_operateInfoPrice(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/base/priceschedule/operate',{
      method:'POST',
      headers:{'Content-type':'application/json'},
      data:body,
      ...(options||{}),
   });
 }

//  s_queryMaterial  ---------------------查询基础数据组件专用--------------------------------------------------------
export async function s_queryBaseData(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/base/query/component',{
      method:'POST',
      headers:{'Content-type':'application/json'},
      data:body,
      ...(options||{}),
   });
 };

//  s_createProduceAlloc ---------------------下达生产单及派工-----2025-04-18----------------------------
export async function s_createProduceAlloc(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/produce/vouch/alloc',{
      method:'POST',
      headers:{'Content-type':'application/json'},
      data:body,
      ...(options||{}),
   });
 }

 //s_oerateInfo----------------------------保存邮编和仓库的冻结删除操作数据，两者通用-----------------------------------
 export async function s_operateInfo(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/base/table/operate',{
      method:'POST',
      headers:{'Content-type':'application/json'},
      data:body,
      ...(options||{}),
   });
 }

 //s_operate2data--------------------------------通用更新表格程序，带明细参数--2025-01-24-----------------
 export async function s_operate2data(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/common/table/operate',{
      method:'POST',
      headers:{'Content-type':'application/json'},
      data:body,
      ...(options||{}),
   });
 }

 //s_getFourDatas  ------------------------------编辑时，获取四项阶段数据-------------------------------------------
 export async function s_getFourDatas(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/business/priceschedule/fourdatas/get',{
      method:'POST',
      headers:{'Content-type':'application/json'},
      data:body,
      ...(options||{}),
   });
 }
  
  //s_updateInfo----------------------------保存表格数据， 通用表格---插入和更新操作--------------------------------
  export async function s_updateInfo(body:{},options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/base/table/update',{
        method:'POST',
        headers:{'Content-Type':'application/json'},
        data:body,
        ...(options||{}),
     });
   }

   //s_produce_updateInfo----------------------------保存表格数据， 生产模块通用表格---插入和更新操作---2025-04-28-----------------------------
  export async function s_produce_updateInfo(body:{},options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/produce/table/update',{
        method:'POST',
        headers:{'Content-Type':'application/json'},
        data:body,
        ...(options||{}),
     });
   };

    //s_sale_updateInfo----------------------------保存表格数据， 生产模块通用表格---插入和更新操作---2025-04-28-----------------------------
  export async function s_updateSaleInfo(body:{},options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/sale/table/update',{
        method:'POST',
        headers:{'Content-Type':'application/json'},
        data:body,
        ...(options||{}),
     });
   };

      //s_purchase_updateInfo----------------------------保存表格数据， 生产模块通用表格---插入和更新操作---2025-04-28-----------------------------
  export async function s_purchase_updateInfo(body:{},options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/purchase/table/update',{
        method:'POST',
        headers:{'Content-Type':'application/json'},
        data:body,
        ...(options||{}),
     });
   };

   ///basis_api/upload/file/htoms2--------------------------htoms2 专用上传文件----------------------------------
   export async function s_uploadFileHtoms2(body:{},options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/upload/file/htoms2',{
        method:'POST',
        headers:{'Content-Type':'application/json'},
        data:body,
        ...(options||{}),
     });
   }

    ///basis_api/upload/file/htoms2--------------------------htoms2 导入EXCEL数据----------------------------------
   export async function s_uploadFileHtoms2Import(body:{},options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/upload/file/htoms2/import',{
        method:'POST',
        headers:{'Content-Type':'application/json'},
        data:body,
        ...(options||{}),
     });
   }

   //**--区域---------保存修改后的数据 body传入包含2个属性：ttype\tdata*/
export async function updateAreaInfo2(body:{},options?:{[key:string]:any}){
  return request('/basis_api/area/update',{
  method:'POST',
  headers:{'Content-Type':'application/json'},
  data:body,   //注意，此处传送data对象
...(options||{}),
}

);
}

   //s_getShippingPeriodMain  -----------------------------调取船期表主表数据-----------------------------------
   export async function s_getShippingPeriod(body:any,options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/shippingperiod/info/get',{
        method:'POST',
        headers:{'Content-type':'application/json'},
        data:body,
        ...(options||{}),
     });
   
   }

   //s_getTableInfo --------------------通用表格的取数函数 2024-10-20---------3参数：source:表名,x_id,id(0时为全部，否则单id)-----------------------
   export async function s_getTableInfo(body:any,options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/table/info/get',{
        method:'POST',
        headers:{'Content-type':'application/json'},
        data:body,
        ...(options||{}),
     });
   
   }

  //  s_caculateRequire      计算主需求   --------------------2025-03-28-----------------------------------
  export async function s_caculateRequire(body:any,options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/require/planning',{
        method:'POST',
        headers:{'Content-type':'application/json'},
        data:body,
        ...(options||{}),
     });
   }

   //s_getUnallocateChanel--------------------------------获取未分配组的渠道明细------------2024-11-07-----------
   export async function s_getUnallocateChanel(body:any,options?:{[key:string]:any}){
     return request('/basis_api/basedata/chanel/unallocate/get',{
        method:'POST',
        headers:{'Content-type':'application/json'},
        data:body,
        ...(options||{}),
     });
    }
//s_saveAllocateChanel -------------------------------------保存渠道分配信息-2024-11-07--------------------------------
export async function s_saveAllocateChanel(body:any,options?:{[key:string]:any}){
  return request('/basis_api/basedata/chanel/allocate/save',{
     method:'POST',
     headers:{'Content-type':'application/json'},
     data:body,
     ...(options||{}),
  });
 }
 //basis_api/basedata/chanel/allocate/operate------------------操作渠道信息  2024-11-07------------
 export async function s_updateAllocateChanel(body:any,options?:{[key:string]:any}){
  return request('/basis_api/basedata/chanel/allocate/operate',{
     method:'POST',
     headers:{'Content-type':'application/json'},
     data:body,
     ...(options||{}),
  });
 }

    //s_getTableInfo --------------------通用表格的取数函数，取子表明细----3参数：source:表名,x_id,mid(0时为全部，否则单id)-----------------------
    export async function s_getTableInfoDetail(body:any,options?:{[key:string]:any}){
      // alert(JSON.stringify(body));
       return request('/basis_api/table/info/detail/get',{
          method:'POST',
          headers:{'Content-type':'application/json'},
          data:body,
          ...(options||{}),
       });
     
     }

   //---------------------------------------------小程序：查询海卡----------
   
  //s_getShippingInfo  ----------------------------获取船公司列表，两个参数：x_id，船公司id:0为全部----------------------
  export async function s_getShippingInfo(body:any,options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/shipping/info/get',{
        method:'POST',
        headers:{'Content-type':'application/json'},
        data:body,
        ...(options||{}),
     });
   
   }
 //冻结删除用户
 export async function  s_freezeuser(params:{id:number,etype:number},options?:{[key:string]:any}){
  const {id:param0,etype:param1,...queryPamrams}=params;
  // console.log(`/basis_api/area/${param0}`);
 const x=request(`/basis_api/userinfo/freeze/${param1}/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}


//获取应用注册信息
export async function getAppRegister(params:{code:any},options?:{[key:string]:any}){
   const {code:param0,...queryParams}=params;
    //console.log('yyyyy:'+`/basis_api/app/register/${param0}`);
   const x=request(`/basis_api/app/register/${param0}`,{
    method:'GET',
    ...(options||{}),
   });
   return x;
}
//保存应用注册：新增或修改
export async function setAppRegister(body: any, options?: { [key: string]: any }) {
  alert(JSON.stringify(body));
  return request('/basis_api/app/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data:  body ,    //注意：此处一定要用data:对象。。。
    ...(options || {}),
    
  });
}

//获取接口注册信息
export async function getAppInterface(params:{code:any},options?:{[key:string]:any}){
    const {code:param0,...queryParams}=params;
    const x=request(`/basis_api/app/interface/register/${param0}`,{
      method:'GET',
      ...(options||{}),
    });
    return x;
}

//保存接口注册：新增 或修改
export async function setInterfaceRegister(body:any,options?:{[key:string]:any}){
 // alert(JSON.stringify(body));
  return request('/basis_api/app/interface/register',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}


//保存仓库信息：新增 或修改(etype,fdata)
export async function updateWarehouse2(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/warehouse/save',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }
 //获取用户信息 ---旧,作废
 export async function getUserInfo(params:{org_code:string,user_code:string},options?:{[key:string]:any}){
  const {org_code:param0,user_code:param1,...queryParams}=params;
  const x=request(`/basis_api/user/${param0}/${param1}`,{
    method:'GET',
    ...(options||{}),
  });
  return x;
}

//s_getRoleUserList------------------获取角色对应的用户列表2024-10-17----------
export async function s_getRoleUserList(params:{role_id:number},options?:{[key:string]:any}){
  const {role_id:param0,...queryParams}=params;
  const x=request(`/basis_api/roleuser/get/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
  return x;
}

//s_updateRoleAllocate---------------------用户角色分配的操作：新增或取消---2024-10-17------
export async function s_updateRoleAllocate(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/roleuser/update',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_getUnAllocateUsers------------------------查询未角色的未分配用户-----2024-10-17---------------
 export async function s_getUnAllocateUsers(params:{role_id:number},options?:{[key:string]:any}){
  const {role_id:param0,...queryParams}=params;
  const x=request(`/basis_api/roleuser/unallocate/get/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
  return x;
}

//获取用户信息---按多级树
export async function getUserInfoByXId(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/user/get',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

//保存用户信息：新增 或修改(etype,fdata)
export async function s_saveUserInfo(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
   return request('/basis_api/user/save',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //调出角色信息
 export async function s_getRole(params:{x_id:number,id:number},options?:{[key:string]:any}){
  const {x_id:param0,id:param1,...queryParams}=params;
  const x=request(`/basis_api/role/get/${param0}/${param1}`,{
    method:'GET',
    ...(options||{}),
  });
  return x;
}

//保存角色信息：新增 或修改(etype,fdata)
export async function s_saveRole(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
   return request('/basis_api/role/save',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_getRoleAllocateOrg--获取角色对应的组织数据，带一个role_code参数
 export async function s_getRoleAllocateOrg(params:{org_id:number},options?:{[key:string]:any}){
  const {org_id:param0,...queryParams}=params;
  const x=request(`/basis_api/role/org/get/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
  return x;
}
//s_getRoleAllocateUser--获取角色对应的组织数据，带一个role_code和org_code参数
export async function s_getRoleAllocateUser(params:{allocate_id:number,},options?:{[key:string]:any}){
  const {allocate_id:param0,...queryParams}=params;
  const x=request(`/basis_api/role/user/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
  return x;
}

//s_getOrgTargetKeys--获取角色-组织已分配数据  
export async function s_getOrgTargetKeys(params:{role_id:number},options?:{[key:string]:any}){
   const {role_id:param0,...queryParams}=params;
  const x=request(`/basis_api/role/org/allocated/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
  return x;
}

//s_getOrgTransferData  ---获取组织分配信息---- 
export async function  s_getOrgTransferData(params:{source?:string,code?:string},options?:{[key:string]:any}){
   const {source:param0,code:param1,...queryPamrams}=params;
  // console.log(`/basis_api/area/${param0}`);
  //传入参数999时，所以SELECTION统一代表全部数据----固定为组织信息
 const x=request(`/basis_api/selection/base_organization/9999`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}

//获取下拉框的数据-----------------------按下拉框select的表名作为参数，获取id和name---2024-10-19-------
export async function  s_getSelectData(params:{source:string,x_id:number},options?:{[key:string]:any}){
  const {x_id:param0,source:param1,...queryPamrams}=params;
const x=request(`/basis_api/select/get/${param0}/${param1}`,{
   method:'GET',
   ...(options||{}),
 });

 return x;
}

// basis_api/select/get/bycondition   按下拉框获取数据，可传入参数   2025-03-25---------------------------
export async function s_getSelectDataByCondition(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
   return request('/basis_api/select/get/bycondition',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

//s_getOrgTargetKeysGlobal--获取项目-组织已分配数据  /basis_api/allocate/org/:item_type/:item_code-----注意：此为通用项
export async function s_getOrgTargetKeysGlobal(params:{x_id:number,item_type:number,item_id:number},options?:{[key:string]:any}){
  const {x_id:param0,item_type:param1,item_id:param2,...queryParams}=params;
 const x=request(`/basis_api/allocate/org/${param0}/${param1}/${param2}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}

//s_saveAllocateOrgRole---保存组织分配结果
export async function s_saveAllocateOrgRole(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
   return request('/basis_api/role/org/save',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_operateChanel --------------------------操作渠道信息：冻结，删除，恢复------2024-10-19------------
 export async function s_operateChanel(params:{otype:number,id:number},options?:{[key:string]:any}){
  const {otype:param0,id:param1,...queryParams}=params;
 const x=request(`/basis_api/base/chanel/operate/${param0}/${param1}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}

 //s_saveChanel---------------------------------保存渠道信息 2024-10-19----------------
 export async function s_saveChanel(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
   return request('/basis_api/base/chanel/save',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_saveAllocateOrgGlobal------------------通用：保存项目+组织分配的结果-------------------
 export async function s_saveAllocateOrgGlobal(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
   return request('/basis_api/allocate/org/save',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }
//s_getPriceScheduleMain----------------------------获取价格表主目录 --------------------------
export async function s_getPriceScheduleMain(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
   return request('/basis_api/priceschedule/main/get',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }
 //s_getPriceSchedule  ---------------------获取价格表----2024-10-23---------------------------------------
 export async function s_getPriceSchedule(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
   return request('/basis_api/priceschedule/get',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_getUserTargetKeys--获取角色-组织已分配数据
export async function s_getUserTargetKeys(params:{allocate_id:number},options?:{[key:string]:any}){
  const {allocate_id:param0,...queryParams}=params;
 const x=request(`/basis_api/role/org/user/allocated/${param0}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}

 //s_saveAllocateUserRole -----------------------保存角色+组织，分配给用户的信息
 export async function s_saveAllocateUserRole(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
   return request('/basis_api/role/org/user/save',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_getUnitData-----------------------获取计量单位表------------------------------
 export async function s_getUnitData(params:{code:string},options?:{[key:string]:any}){
  const {code:param0,...queryParams}=params;
 const x=request(`/basis_api/unit/get/${param0}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}

//s_saveUnitData  -------------------------保存计量单位数据------------------------
export async function s_saveUnitData(body:any,options?:{[key:string]:any}){
   //alert(JSON.stringify(body));
   return request('/basis_api/unit/save',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_getCategoryInfo  ---------------------获取物料分类明细信息----------------------------------
 export async function s_getCategoryInfo(params:{id:number},options?:{[key:string]:any}){
  const {id:param0,...queryParams}=params;
 const x=request(`/basis_api/materialcategory/get/${param0}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}
 

//s_saveMaterialCategory--------------------------------------------保存物料分类信息-----------------
export async function s_saveMaterialCategory(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
  return request('/basis_api/materialcategory/save',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

//s_getMaterialDocument -----------------------根据物料类别，取存货 档案--------------------------------------
export async function s_getMaterialDocument(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/material/xid/get',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_getMaterialDocument -----------------------根据物料类别，取存货工艺表--2025-03-22------------------------------------
export async function s_getMaterialDocumentCraft(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/material/xid/get/craft',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //jwt路径测试  2025-07-25--  authorization
export async function test_jwt(body:any,options?:{[key:string]:any}){
  //获取cookie中的token
   let token=Cookies.get('token');
   return request('/basis_api/test/jwt',{
     method:'POST',
     headers:{'Content-type':'application/json',
              'Authorization': `Bearer ${token}`
     },
     data:{body,token},
     ...(options||{}),
   });
 }
 //s_getDocument -----------------------根据类别，取下属的档案----------通用2025-03-16----------------------------
export async function s_getDocument(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/document/xid/get',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 export async function s_getQuotePrice(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/quoteprice/get',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //basis_api/common/tableinfo/xid/get  ---------------通用表格多级分类取数 v 表格-2024-12-31 ----------------------------------
 export async function s_getcommontableinfo(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/common/tableinfo/xid/get',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_stockOut库存模块出库业务集中管理--------------------------2025-04-22------------------------------------
 export async function s_stockOut(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/common/stock/out/xid',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 };

 //s_stockOut库存模块查询集中管理--------------------------2025-04-22------------------------------------
 export async function s_getStockInfo(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/common/stock/get/info',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 };

 //s_stockOut库存模块查询集中管理--------------------------2025-04-22------------------------------------
 export async function s_getProduceInfo(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/common/produce/get/info',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 };
 
 //销售模块查询集中管理--------------------------2025-05-30-----------------------------------
 export async function s_getSaleInfo(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/common/sale/get/info',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 };
 //采购模块查询集中管理--------------------------2025-05-24------------------------------------
 export async function s_getPurchaseInfo(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/common/purchase/get/info',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 };

  //s_stockIn库存模块入库业务集中管理--------------------------2025-04-24------------------------------------
  export async function s_stockIn(body:any,options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/common/stock/in/xid',{
       method:'POST',
       headers:{'Content-type':'application/json',},
       data:body,
       ...(options||{}),
     });
   };

  //basis_api/common/tableinfo/condition/get  ---------------通用表格按查询条件取数 2025-01-06-----------------------------------
  export async function s_getcommontableinfoBycondition(body:any,options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/common/tableinfo/condition/get',{
       method:'POST',
       headers:{'Content-type':'application/json',},
       data:body,
       ...(options||{}),
     });
   }

   ///basis_api/file/get-------------------------------从后台获取PDF或图片文件，并返回显示-----------------------
   export async function s_getFileInfo(body:any,options?:{[key:string]:any}){
    //  alert(JSON.stringify(body));
     return request('/basis_api/file/get',{
       method:'POST',
       headers:{'Content-type':'application/json',},
       data:body,
       ...(options||{}),
     });
   }
 

  //basis_api/common/tableinfo/xid/get  ---------------通用按多级树选择取数  表格-2024-12-31--------------------------------------------
  export async function s_getmaterialgroup(body:any,options?:{[key:string]:any}){
    // alert(JSON.stringify(body));
     return request('/basis_api/materialgroup/xid/get',{
       method:'POST',
       headers:{'Content-type':'application/json',},
       data:body,
       ...(options||{}),
     });
   }

//s_saveMaterialGroupInfo  ------------------------------保存物料组     信息-------------------------------------------
export async function s_saveMaterialGroupInfo(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
  return request('/basis_api/material/group/xid/save',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

//s_saveMaterialGroupInfo  ------------------------------保存物料档案信息-------------------------------------------
export async function s_saveMaterialInfo(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
  return request('/basis_api/material/xid/save',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

// /basis_api/material/image/del-----------------------------------删除多余图片-2025-06-16---------------------
export async function s_delimg(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
  return request('/basis_api/material/image/del',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

//s_saveBusinessInfo  ------------------------------保存客商档案信息-------------------------------------------
export async function s_saveBusinessInfo(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
  return request('/basis_api/business/xid/save',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

//s_getUserDefine  --------------------------------获取用户自定义项列表---------------------------------------
export async function s_getUserDefine(params:{x_id:number,source:string,code:string},options?:{[key:string]:any}){
  const {x_id:param0,source:param1,code:param2,...queryParams}=params;
 const x=request(`/basis_api/userdefine/get/${param0}/${param1}/${param2}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}

//s_saveUserDefine  -------------------------------保存用户自定义项----------------------------------------------
export async function s_saveUserDefine(body:any,options?:{[key:string]:any}){
  return request('/basis_api/userdefine/save',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

//s_getUserdefine_doc --------------------------------获取用户自定义项档案-----------------------------------------
export async function s_getUserdefine_doc(params:{source:number,code:string},options?:{[key:string]:any}){
  const {source:param0,code:param1,...queryParams}=params;
 const x=request(`/basis_api/userdefine/doc/get/${param0}/${param1}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}

//s_saveUserdefineDoc---------------------------添加单个自定义档案值-----------------------------
export async function s_saveUserdefine_doc(body:any,options?:{[key:string]:any}){
  return request('/basis_api/userdefine/doc/save',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

//s_updateUserdefine_doc  -------------------------保存自定义档案值：仅表格批量修改功能----------------------------
export async function s_updateUserdefine_doc(body:any,options?:{[key:string]:any}){
  return request('/basis_api/userdefine/doc/update',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

// s_getMaterialUserDefine  ----------------------物料档案，编辑自定义项------------------------------------------
export async function s_getMaterialUserDefine(params:{x_id:number,source_type:number,item_id:number},options?:{[key:string]:any}){
  const {x_id:param0,source_type:param1,item_id:param2,...queryParams}=params;
 const x=request(`/basis_api/material/userdefine/xid/get/${param0}/${param1}/${param2}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}

//s_saveMaterialUserDefine  ------------------------物料档案，保存自定义项-----------------------------------------
export async function s_saveMaterialUserDefine(body:any,options?:{[key:string]:any}){
  return request('/basis_api/material/userdefine/save',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

 ///basis_api/treedata/business/category     ----------获取客商分类树的值------
 export async function s_getBusinessCategoryTree(options?:{[key:string]:any}){
  return request('/basis_api/treedata/business/category',{
   method:'GET',
   ...(options||{}),
  });
}

 //s_getBusinessCategoryInfo  ---------------------获取客商分类明细信息----------------------------------
 export async function s_getBusinessCategoryInfo(params:{id:number},options?:{[key:string]:any}){
  const {id:param0,...queryParams}=params;
 const x=request(`/basis_api/businesscategory/get/${param0}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}
//s_saveBusinessCategory--------------------------------------------保存客商分类信息-----------------
export async function s_saveBusinessCategory(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
  return request('/basis_api/business/category/save',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

//s_getBusinessDocument -----------------------根据客商类别，取客商档案列表--------------------------------------
export async function s_getBusinessDocument(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/business/xid/get',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_getBusinessDocument2 -----------------------根据客商类别，取客户或供应商档案列表---注意区分客商列表--，多org_id参数-------------------------------
export async function s_getBusinessDocument2(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/business/xid/org/get',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }
 

//s_getBusinessDefine------------------获取客商定义信息。注意：只限于已分配组织-----------------------
export async function s_getBusinessDefine(params:{org_id:string,item_id:string},options?:{[key:string]:any}){
  const {org_id:param0,item_id:param1,...queryParams}=params;
 const x=request(`/basis_api/business/define/get/${param0}/${param1}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}

//s_saveBusinessDefine------------------保存客商定义信息。注意：只限于已分配组织-----------------------
export async function s_saveBusinessDefine(body:any,options?:{[key:string]:any}){
  //alert(JSON.stringify(body));
  return request('/basis_api/business/define/save',{
    method:'POST',
    headers:{'Content-type':'application/json',},
    data:body,
    ...(options||{}),
  });
}

//s_getBusinessDocumentDoc----------------------------获取客户、供应商基本-信息----------------------------------
//通过参数dtype：1供应商，2客户
export async function s_getBusinessDocumentDoc(params:{cate_code:string,code:string,dtype:string},options?:{[key:string]:any}){
  const {cate_code:param0,code:param1,dtype:param2,...queryParams}=params;
 const x=request(`/basis_api/business/doc/get/${param0}/${param1}/${param2}`,{
   method:'GET',
   ...(options||{}),
 });
 return x;
}


//获取收发类别树的值
export async function s_getIoTypeTree(params:{x_id:number},options?:{[key:string]:any}){
   const {x_id:param0,...queryParams}=params;
  return request(`/basis_api/iotype/tree/get/${param0}`,{
   method:'GET',
   ...(options||{}),
  });
}

//获取收发类别明细信息
export async function  s_getIoTypeInfo(params:{id:any},options?:{[key:string]:any}){
  const {id:param0,...queryPamrams}=params;
  // console.log(`/basis_api/area/${param0}`);
 const x=request(`/basis_api/iotype/get/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}

//s_updateIoTypeInfo  --------保存收发类别信息-----------
export async function s_updateIoTypeInfo(body:{},options?:{[key:string]:any}){
  return request('/basis_api/iotype/update',{
  method:'POST',
  headers:{'Content-Type':'application/json'},
  data:body,   //注意，此处传送data对象
...(options||{}),
}

);
}

//获取订单类别树的值
export async function s_getOrderTypeTree(options?:{[key:string]:any}){
  return request('/basis_api/ordertype/tree/get',{
   method:'GET',
   ...(options||{}),
  });
}

//获取订单类别明细信息
export async function  s_getOrderTypeInfo(params:{id:any},options?:{[key:string]:any}){
  const {id:param0,...queryPamrams}=params;
  // console.log(`/basis_api/area/${param0}`);
 const x=request(`/basis_api/ordertype/get/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}

//s_updateOrderTypeInfo  --------保存订单类别信息-----------
export async function s_updateOrderTypeInfo(body:{},options?:{[key:string]:any}){
  return request('/basis_api/ordertype/update',{
  method:'POST',
  headers:{'Content-Type':'application/json'},
  data:body,   //注意，此处传送data对象
...(options||{}),
}
);
}

//s_saveAdjustState  ----------------------保存客商合作状态调整结果------------------
export async function s_saveAdjustState(body:{},options?:{[key:string]:any}){
  return request('/basis_api/business/state/update',{
  method:'POST',
  headers:{'Content-Type':'application/json'},
  data:body,   //注意，此处传送data对象
...(options||{}),
}
);
}

//mes_saveOrganizationInfo   ------------------保存X组织注册信息-----------------
export async function mes_saveXOrganization(body:{},options?:{[key:string]:any}){
  return request('/basis_api/xorganization/register',{
  method:'POST',
  headers:{'Content-Type':'application/json'},
  data:body,   //注意，此处传送data对象
...(options||{}),
}
);
}

//mes_getXOrganization  ----------------------------获取X组织信息表-----------------------
export async function  mes_getXOrganization(params?:{},options?:{[key:string]:any}){
//  const {code:param0,...queryPamrams}=params;
  // console.log(`/basis_api/area/${param0}`);
 const x=request(`/basis_api/xorganiation/get/list`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}

//mes_saveSysOptions ------------------------------系统设置----------------------------------
export async function mes_saveSysOptions(body:{},options?:{[key:string]:any}){
  return request('/basis_api/sysoptions/save',{
  method:'POST',
  headers:{'Content-Type':'application/json'},
  data:body,   //注意，此处传送data对象
...(options||{}),
}
);
}


//mes_getSysOptions  ----------------------------获取X组织信息表-----------------------
export async function  mes_getSysOptions(params:{x_id:number},options?:{[key:string]:any}){
   const {x_id:param0,...queryPamrams}=params;
   // console.log(`/basis_api/area/${param0}`);
   const x=request(`/basis_api/sysoptions/get/${param0}`,{
      method:'GET',
      ...(options||{}),
    });
   
    return x;
  }

  //获取区域树的值----X组织
  export async function getAreaTreeByXid(params:{x_id:number},options?:{[key:string]:any}){
    const {x_id:param0,...queryParams}=params;
    return request(`/basis_api/areatree/xid/${param0}`,{
     method:'GET',
     ...(options||{}),
    });
  }

  //获取通用树的值---X组织------------------------------------------通用树，完整------------------------------------
  export async function getFullTreeByXid(params:{x_id:number,treeType:string},options?:{[key:string]:any}){
    const {x_id:param0,treeType:param1,...queryParams}=params;
    return request(`/basis_api/fulltree/xid/${param0}/${param1}`,{
      method:'GET',
      ...(options||{}),
    });
  }

  //获取区域明细信息
export async function  getAreaInfoById(params:{id:any},options?:{[key:string]:any}){
  const {id:param0,...queryPamrams}=params;
  // console.log(`/basis_api/area/${param0}`);
 const x=request(`/basis_api/area/get/id/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}

//获取树节点的明细信息-------------------------------------通用，参数为：类型+ID-------------------------------------
export async function getTreeNodeInfoById(params:{treeType:string,key:number},options?:{[key:string]:any}){
  const {treeType:param0,key:param1,...queryParams}=params;
  const x=request(`/basis_api/treenode/${param0}/${param1}`,{
     method:'GET',
     ...(options||{}),
  });
  return x;
}

//获取组织树的值----X组织
export async function getOrgTreeByXid(params:{x_id:number},options?:{[key:string]:any}){
  const {x_id:param0,...queryParams}=params;
  return request(`/basis_api/orgtree/xid/${param0}`,{
   method:'GET',
   ...(options||{}),
  });
}

////获取组织明细信息--按ID获取--
export async function  getOrgInfoById(params:{id:number},options?:{[key:string]:any}){
  const {id:param0,...queryPamrams}=params;
  // console.log(`/basis_api/area/${param0}`);
 const x=request(`/basis_api/organization/id/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}

//getOrgTreeByXidForOrg-------------------调用仅为组织的结构树，排除部门，即org_type为1或2-------------
//获取组织树的值----X组织--非部门或车间
export async function getOrgTreeByXidForOrg(params:{x_id:number},options?:{[key:string]:any}){
  const {x_id:param0,...queryParams}=params;
  return request(`/basis_api/orgtree/xid/org/${param0}`,{
   method:'GET',
   ...(options||{}),
  });
}

//获取组织树--表单项TreeSelect使用
export async function mes_getSelectOrgTree(params:{x_id:number,type:number},options?:{[key:string]:any}){
  const {x_id:param0,type:param1,...queryParams}=params;
 return request(`/basis_api/treeselect/orgtree/byid/${param0}/${param1}`,{
   method:'GET',
   ...(options||{}),
 });
}

//获取通用树--表单项TreeSelect使用
export async function s_getSelectTree(params:{x_id:number,source:string},options?:{[key:string]:any}){
  const {x_id:param0,source:param1,...queryParams}=params;
 return request(`/basis_api/treeselect/common/${param0}/${param1}`,{
   method:'GET',
   ...(options||{}),
 });
}

//获取区域树--表单项TreeSelect使用
export async function srm_getSelectAreaTree(options?:{[key:string]:any}){
  return request('/basis_api/treeselect/areatree',{
    method:'GET',
    ...(options||{}),
  });
}

//s_getCurrency  -------------------获取币种------------------------------
export async function s_getCurrency(params:{id:number},options?:{[key:string]:any}){
  const {id:param0,...queryParams}=params;
  return request(`/basis_api/currency/get/${param0}`,{
    method:'GET',
    ...(options||{}),
  });
}

//s_saveCurrency  ---------------------保存币种信息------------------------------------------
export async function s_saveCurrency(body:{},options?:{[key:string]:any}){
  return request('/basis_api/currency/save',{
  method:'POST',
  headers:{'Content-Type':'application/json'},
  data:body,   //注意，此处传送data对象
...(options||{}),
}
);
}

//s_getReason  -------------------获取不良------------------------------
export async function s_getReason(params:{x_id:number,id:number},options?:{[key:string]:any}){
  const {x_id:param0,id:param1,...queryParams}=params;
  return request(`/basis_api/reason/get/${param0}/${param1}`,{
    method:'GET',
    ...(options||{}),
  });
}

//s_saveReason  ---------------------保存不良信息------------------------------------------
export async function s_saveReason(body:{},options?:{[key:string]:any}){
  return request('/basis_api/reason/save',{
  method:'POST',
  headers:{'Content-Type':'application/json'},
  data:body,   //注意，此处传送data对象
...(options||{}),
}
);
}

//getBankTableByXId  -------------------------------获取银行列表-----------------
export async function getBankTableByXId(params:{x_id:number,org_id:number},options?:{[key:string]:any}){
  const {x_id:param0,org_id:param1,...queryParams}=params;
   return request(`/basis_api/banktable/xid/${param0}/${param1}`,{   //带参数的功能，用一天研究出来。。汗20230922
   method:'GET',
   ...(options||{}),
});
}

//保存银行信息：新增 或修改(etype,fdata)
export async function s_saveBank(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/bank/save',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //getCommTreeByXid(x_id,sourceTable)  -----------------------获取通用树创建BY-XID-------------
 export async function getCommTreeByXid(params:{x_id:number,source_table:string},options?:{[key:string]:any}){
  const {x_id:param0,source_table:param1,...queryParams}=params;
  return request(`/basis_api/comm/tree/xid/${param0}/${param1}`,{ 
   method:'GET',
   ...(options||{}),
  });
}

 //s_getBusDefine  --------------------------按组织id获取客商的定义------------
 export async function s_getBusDefine(params:{org_id:number,item_id:number},options?:{[key:string]:any}){
  const {org_id:param0,item_id:param1,...queryParams}=params;
  return request(`/basis_api/business/definevc/${param0}/${param1}`,{ 
   method:'GET',
   ...(options||{}),
  });
}

//s_getGrantModel({sysid}) ------------------------按系统ID获取模块列表，用于授权-------------------------------
export async function s_getGrantModel(params:{sysid:number},options?:{[key:string]:any}){
  const {sysid:param0,...queryParams}=params;
  return request(`/basis_api/grant/getmodel/${param0}`,{ 
   method:'GET',
   ...(options||{}),
  });
}

//s_getGrantDetails({org_id,role_id,model_id})
export async function s_getGrantDetails(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/grant/get/grantlist',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 //s_getLoginCount({px_id,pmodel,type,begindate,enddate})
export async function s_getLoginCount(body:any,options?:{[key:string]:any}){
  // alert(JSON.stringify(body));
   return request('/basis_api/miniprogram/login/count/get',{
     method:'POST',
     headers:{'Content-type':'application/json'},
     data:body,
     ...(options||{}),
   });
 }

 //====================================================用户登录及授权====================================
 /** 获取当前的用户 GET /api/currentUser */
//获取用户信息 2024-11-13
 export async function s_currentUser(body:any,options?: { [key: string]: any }) {
  return request<{
    data: API.CurrentUser;
  }>('/basis_api/currentUser', {
    method: 'POST',
    data:body,
    ...(options || {}),
  });
}

/** 退出登录接口 POST /api/login/outLogin  2024-11-13 */
export async function s_outLogin(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/basis_api/login/outLogin', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 登录接口 POST /api/login/account  2024-11-13*/
export async function s_login(body: API.LoginParams, options?: { [key: string]: any }) {
  return request<API.LoginResult>('/basis_api/login/account', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /api/notices */
export async function getNotices(options?: { [key: string]: any }) {
  return request<API.NoticeIconList>('/api/notices', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 获取规则列表 GET /api/rule */
export async function rule(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RuleList>('/api/rule', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新规则 PUT /api/rule */
export async function updateRule(options?: { [key: string]: any }) {
  return request<API.RuleListItem>('/api/rule', {
    method: 'POST',
    data:{
      method: 'update',
      ...(options || {}),
    }
  });
}

/** 新建规则 POST /api/rule */
export async function addRule(options?: { [key: string]: any }) {
  return request<API.RuleListItem>('/api/rule', {
    method: 'POST',
    data:{
      method: 'post',
      ...(options || {}),
    }
  });
}

/** 删除规则 DELETE /api/rule */
export async function removeRule(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/rule', {
    method: 'POST',
    data:{
      method: 'delete',
      ...(options || {}),
    }
  });
}

//state2text ----------------------------state转换数字为文本----------------------
export   function  state2text(vtype:number,num:number){
  //  参数：vtype:1采购方，2销售方 ；num:值
    var text;
    if(vtype==1)
      switch(num){
          case 1: text='未下达';break;
          case 2: text='已下达';break;
          case 3: text='供方确认';break;
          case 4: text='供方拒绝';break;
          case 5: text='已确认';break;
          case 6: text='已拒绝';break;
          case 7: text='撤销确认';break;
          case 8: text='供方撤销确认';break;
          case 9: text='撤回下达';break;
          case 10: text='未提交';break;
          case 11: text='已提交';break;
          case 12: text='撤销提交';break;
          case 13:text='已核价';break;
          case 14:text='撤销核价';break;
          default :text='不明确';
        }
    else
      switch(num){
          case 1: text='未下达';break;
          case 2: text='已下达';break;
          case 3: text='已确认';break;
          case 4: text='已拒绝';break;
          case 5: text='客户已确认';break;
          case 6: text='客户已拒绝';break;
          case 7: text='客户撤销确认';break;
          case 8: text='撤销确认';break;
          case 9: text='客户撤销下达';break;
          case 10: text='未提交';break;
          case 11: text='已提交';break;
          case 12: text='撤销提交';break;
          case 13:text='已核价';break;
          case 14:text='撤销核价';break;
          default :text='不明确';
       }; 

   return text;
 }

 export function status2text(num:number){
    // vtype:1采购方--2销售方
    var text;
    switch(num){
        case 0: text='进行中';break;
        case 1: text='正常';break;
        case 2: text='关闭';break;
        case 3: text='已删除';break;
        case 4: text='已审核不同意';break;
        case 5: text='已审核同意';break;
        case 6: text='取消审核';break;
         
        }
    return text;
 }
